package com.vip.seata.at.business.controller;

import com.vip.seata.at.business.feign.OrderFeign;
import com.vip.seata.at.business.service.BusinessService;
import com.vip.seata.at.business.tcc.MallTccService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/mock")
public class MockController {

    @Autowired
    OrderFeign iOrderFeign;

    //使用Seata
    @GetMapping("/order/create")
    public String purchase(String userId, String commodityCode, int orderCount) {
        log.info("purchase start ...");
        iOrderFeign.create(userId,commodityCode,orderCount);
        return "success";
    }
}
